package cn.com.demo.microservice.consumer.controller;

import cn.com.demo.microservice.consumer.service.IRoleService;
import cn.com.demo.microservice.reps.ResponseObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("role")
public class RoleController {
    @Autowired
    private IRoleService iRoleService;
    @RequestMapping("delete/{id}")
    public ResponseObject delete(@PathVariable int id){
        ResponseObject res = new ResponseObject();
        boolean is = this.iRoleService.deteleById(id);
        if(is=true){
            res.setMessage("删除成功");
        }else {
            res.setCode(500001);
            res.setMessage("删除成功");
        }
        return res;
    }
}
